<template>
  <div class="vue-store" v-size-ob="changeSize">
    <div>
      <el-button @click="resetAllData">点击清空网站参数</el-button>
      <el-button @click="changeName">改变name</el-button>
      <el-button @click="getPageAllData">获取当前页面所有的vuex值</el-button>
    </div>
    <div>
      <p class="show-txt">sidebarLayoutSkin_1: {{ sidebarLayoutSkin_1 }}</p>
      <p class="show-txt">name: {{ name }}</p>
      <p class="show-txt">sex: {{ sex }}</p>
      <p class="show-txt">money: {{ money }}</p>
      <p class="show-txt">classes: {{ classes }}</p>
      <p class="show-txt">jiJie: {{ jiJie }}</p>
      <p class="show-txt">objes: {{ objes }}</p>
      <p class="show-txt">vue过滤器保留小数: {{ 0.1235452 | round(2) }}</p>
    </div>
  </div>
</template>
<script>
import { mapState, mapGetters } from "vuex";
export default {
  data() {
    return {};
  },
  mounted() {},
  computed: {
    // ...mapState("vueStore", ["name", "sex"]),
    ...mapGetters({
      sidebarLayoutSkin_1: "sidebarLayoutSkin_1",
      name: "vueStore/name",
      sex: "vueStore/sex",
      money: "vueStore/money",
      classes: "vueStore/classes",
      jiJie: "vueStore/jiJie",
      objes: "vueStore/objes",
    }),
  },
  methods: {
    changeSize() {},
    resetAllData() {
      this.$store.commit("resetStore");
    },
    changeName() {
      let num = Math.floor(Math.random() * 10);
      this.$store.commit("vueStore/set_name", this.name + num);
    },
    getPageAllData() {
      this.$store.dispatch("vueStore/get_manInfo", { myparams: "我的入参" });
    },
  },
};
</script>
<style scoped lang="scss">
.show-txt {
  margin: 10px 0;
}
</style>
